<template>
    <div class="container">
        <span  @click="onClick">我是父组件</span>
        <Child></Child>
    </div>

</template>

<script setup>
    import Child from './Child.vue';
    let emit = defineEmits(['clickParent'])
    function onClick() {
        console.log("onClick()")
        emit('clickParent',"父组件被点击")
    }
</script>
<style scoped>
    span {
        color: blue;
        cursor: pointer;
    }
</style>